﻿<UserControl x:Class="Vibstudio.NetConfigurator.UI.Views.HomeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:ac="clr-namespace:Vibstudio.NetConfigurator.UI.Controls;assembly=Vibstudio.NetConfigurator.UI.Controls"
             xmlns:local="clr-namespace:Vibstudio.NetConfigurator.UI"
             IsEnabled="{Binding IsEnabled, UpdateSourceTrigger=PropertyChanged}">

    <ac:AdornedControl Name="LoadingAdorner"
                       IsAdornerVisible="{Binding OperationInProgress, UpdateSourceTrigger=PropertyChanged}">
        <ac:AdornedControl.AdornerContent>
            <local:LoadingWait />
        </ac:AdornedControl.AdornerContent>
        <Grid x:Name="MainGrid"
              Margin="10"
              Grid.Column="1"
              Grid.Row="0"
              Visibility="{Binding MainVisibility, UpdateSourceTrigger=PropertyChanged}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="190" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="50" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBox Grid.ColumnSpan="2"
                     Grid.Row="0"
                     Margin="3,15,15,15"
                     Text="{Binding RootPath, UpdateSourceTrigger=PropertyChanged}"
                     VerticalContentAlignment="Center" />
            <Button Grid.Column="2"
                    Grid.Row="0"
                    Command="{Binding BrowseCommand}"
                    Template="{StaticResource BrowseButton}"
                    ClickMode="Release"
                    BorderThickness="0"
                    BorderBrush="Transparent">
                <Button.ToolTip>
                    <ToolTip Content="{Binding ChooseApplicationPathToolTip, UpdateSourceTrigger=PropertyChanged}"
                             Template="{DynamicResource InformationToolTip}" />
                </Button.ToolTip>
            </Button>
            <Label Grid.Column="1"
                   Grid.Row="1"
                   FontSize="14"
                   Margin="15"
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Center"
                   Content="{Binding IsBackupLabel, UpdateSourceTrigger=PropertyChanged}"
                   HorizontalContentAlignment="Right" />
            <CheckBox Grid.Column="2"
                      Grid.Row="1"
                      IsChecked="{Binding IsBackup, UpdateSourceTrigger=PropertyChanged}"
                      HorizontalAlignment="Center"
                      VerticalAlignment="Center" />
            <Expander ExpandDirection="Up"
                      IsExpanded="{Binding IsConfigModeExpanded, UpdateSourceTrigger=PropertyChanged}"
                      Grid.ColumnSpan="1"
                      Grid.RowSpan="3"
                      Padding="-2,1,1,8"
                      VerticalAlignment="Bottom">
                <Expander.Header>
                    <BulletDecorator>
                        <Label Content="{Binding ConfigMode, UpdateSourceTrigger=PropertyChanged}"
                               Foreground="{StaticResource ModeLabelForegroundBrush}" />
                    </BulletDecorator>
                </Expander.Header>
                <Expander.Content>
                    <Grid x:Name="ConfigurationModeGrid">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="25" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="30" />
                            <RowDefinition Height="30" />
                        </Grid.RowDefinitions>
                        <CheckBox Grid.Column="0"
                                  Grid.Row="0"
                                  HorizontalAlignment="Center"
                                  IsChecked="{Binding IsConfiguration, UpdateSourceTrigger=PropertyChanged}"
                                  VerticalAlignment="Center" />
                        <Label Content="{Binding Configuration, UpdateSourceTrigger=PropertyChanged}"
                               Grid.Column="1"
                               Grid.Row="0"
                               Padding="4,7" />
                        <CheckBox Grid.Column="0"
                                  Grid.Row="1"
                                  HorizontalAlignment="Center"
                                  IsChecked="{Binding IsComposition, UpdateSourceTrigger=PropertyChanged}"
                                  VerticalAlignment="Center" />
                        <Label Content="{Binding Composition, UpdateSourceTrigger=PropertyChanged}"
                               Grid.Column="1"
                               Grid.Row="1"
                               Padding="4,7" />
                    </Grid>
                </Expander.Content>
            </Expander>
            <Button Grid.Column="2"
                    Grid.Row="2"
                    Command="{Binding ExecuteConfigurationCommand}"
                    Template="{StaticResource ExecuteButton}"
                    ClickMode="Release"
                    BorderThickness="0"
                    BorderBrush="Transparent">
                <Button.ToolTip>
                    <ToolTip Content="{Binding RunConfigurationToolTip, UpdateSourceTrigger=PropertyChanged}"
                             Template="{DynamicResource InformationToolTip}" />
                </Button.ToolTip>
            </Button>
        </Grid>
    </ac:AdornedControl>

</UserControl>
